import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysRolePrivilegeRelation = (params) => {
  params.head.transCode = 'querySysRolePrivilegeRelation';
  return request({
    url: '/platform/sysRolePrivilegeRelation/querySysRolePrivilegeRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysRolePrivilegeRelationListPage = (params) => {
  params.head.transCode = 'querySysRolePrivilegeRelationListPage';
  return request({
    url: '/platform/sysRolePrivilegeRelation/querySysRolePrivilegeRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysRolePrivilegeRelation = (params) => {
  params.head.transCode = 'saveSysRolePrivilegeRelation';
  return request({
    url: '/platform/sysRolePrivilegeRelation/saveSysRolePrivilegeRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysRolePrivilegeRelationList = (params) => {
  params.head.transCode = 'saveSysRolePrivilegeRelationList';
  return request({
    url: '/platform/sysRolePrivilegeRelation/saveSysRolePrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysRolePrivilegeRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysRolePrivilegeRelation';
  return request({
    url: '/platform/sysRolePrivilegeRelation/saveOrUpdateSysRolePrivilegeRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysRolePrivilegeRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysRolePrivilegeRelationList';
  return request({
    url: '/platform/sysRolePrivilegeRelation/saveOrUpdateSysRolePrivilegeRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysRolePrivilegeRelation = (params) => {
  params.head.transCode = 'updateSysRolePrivilegeRelation';
  return request({
    url: '/platform/sysRolePrivilegeRelation/updateSysRolePrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysRolePrivilegeRelation = (params) => {
  params.head.transCode = 'deleteSysRolePrivilegeRelation';
  return request({
    url: '/platform/sysRolePrivilegeRelation/deleteSysRolePrivilegeRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysRolePrivilegeRelationList = (params) => {
  params.head.transCode = 'deleteSysRolePrivilegeRelationList';
  return request({
    url: '/platform/sysRolePrivilegeRelation/deleteSysRolePrivilegeRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysRolePrivilegeRelationExcel = (params) => {
  downloadExcel({
    url: '/platform/sysRolePrivilegeRelation/excelDownload/exportSysRolePrivilegeRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
